#ifndef TDOWNLOAD_H
#define TDOWNLOAD_H

#include <QThread>
#include <QStringList>
#include <QUrl>
#include <QFileInfo>
#include <QDir>
#include <QFile>
#include <QHttp>
#include <QEventLoop>
#include <QMessageBox>
#include "uniquedl.h"

class TDownload : public QThread
{
    Q_OBJECT
public:
    explicit TDownload(QObject *parent, QStringList file_list);
    void run();
    
signals:
    void updateProgress(int, int);
    void done();
    void changeStatus(QString);

public slots:
    void            chargementTermine();
    void            downloadProgress(int, int);
    void            startDownload();
protected:
    QFile           *file;

private:
    QStringList     file_list;
    QString         url;
    QString         path;
    UniqueDl        *current;
    int             iterator;

    void            downloadFile(QString);
};

#endif // TDOWNLOAD_H
